<div class="py-4">
  <div class="px-4 flex items-center justify-between gap-2 cpy-project-navigation">
    <h2 class="flex items-center text-base-content/80 text-2xl pl-2 font-semibold">
      <% if local_assigns[:sub_section] %>
        <div class="flex gap-2 items-center">
          <% if sub_section[:icon] %>
            <%= icon_for(sub_section[:icon]) %>
          <% end %>
          <span><%= sub_section[:title] %> - <%= project.name %></span>
        </div>
      <% else %>
        <%= project.name %>
      <% end %>
    </h2>
    <div class="flex items-center">
      <%= link_to time_entries_path(new_entry: { project_id: project.id }), class: "btn btn-sm btn-ghost", data: { turbo_frame: "_top" } do %>
        <%= icon_for(:time_entries) %>
        <%= t("actions.start_time_tracking") %>
      <% end %>
      <%= link_to project_issue_labels_path(project.id),
        class: "btn btn-sm btn-ghost tour--issue-labels",
        data: { turbo_frame: "_top" } do %>
        <%= icon_for(:issue_labels) %>
        <%= t(:manage_issue_labels, scope: :nav) %>
      <% end %>
    </div>
  </div>

  <div class="mt-4  px-4 flex gap-4 text-sm font-medium tour--project-navigation-tabs">
    <%

      tabs = [{
          icon: icon_for(:issues),
          text: t(:all_issues, scope: :nav),
          options: { href: project_issues_path(project) },
          is_selected: controller_name.downcase == 'issues'
        },{
          icon: icon_for(:boards),
          text: Visualization.model_name.human,
          options: { href: visualization_path(project.default_visualization) },
          is_selected: controller_name.downcase == 'visualizations'
        }
      ].each do |tab|

      tab[:options][:class] = "flex items-center gap-1 px-2 pb-2 whitespace-nowrap hover:text-accent"
      tab[:options][:data] = { turbo_frame: "_top" }
      if tab[:is_selected]
        tab[:options][:class] += " border-b-2 border-accent text-accent"
      end
    %>
      <%= content_tag :a, tab[:options] do %>
        <span class="text-xs"><%= tab[:icon] %></span>
        <%= tab[:text] %>
      <% end %>
    <% end %>
  </div>
  <div class="border-b border-base-300 h-0.5" style="margin-top: -2px;"></div>
</div>
